package com.bestcem.xm.ticket.controller.param.ticket.config;

import com.bestcem.xm.ticket.entity.mongo.TicketTemplate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author liheng
 * @version v1.0
 * @date 2021/8/19 15:44
 */
@Data
public class TicketTemplateParam {

    private List<FieldInfo> customFields;

    private Integer customFieldLimit;

    private Integer category;
    /**
     * 前端不传，工单配置id
     */
    private String ticketConfigId;

    /**
     * 前端不传，组织id
     */
    private String orgId;

    /**
     * 前端不传，用户id
     */
    private String userId;

    /**
     * 工单模板id
     */
    private String id;

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    public static class FieldInfo implements Serializable {
        private static final long serialVersionUID = 2808726620840986656L;

        /**
         * field
         */
        private String field;

        /**
         * text
         */
        private String text;

        /**
         * type
         */
        private String type;

        /**
         * required
         */
        private Object required;

        /**
         * options
         */
        private List<TicketTemplate.FieldInfo.Option> options;

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class Option implements Serializable {
            private static final long serialVersionUID = 2808726620840986656L;

            /**
             * text
             */
            private String text;

            /**
             * value
             */
            private Integer value;
        }
    }
}
